package simplescenegraph.math;

public class Vertex3f {

	public Vector3f position;

	public Vector3f normal;

	public Vector2f uvCoordinate;

	public Color3f color;

	public Vertex3f() {
		position = new Vector3f();
		normal = new Vector3f(Vector3f.Y_AXIS);
		uvCoordinate = new Vector2f();
		color = new Color3f(Color3f.white);
	}

	public Vertex3f(float p0, float p1, float p2) {
		position = new Vector3f(p0, p1, p2);
		normal = new Vector3f(Vector3f.Y_AXIS);
		uvCoordinate = new Vector2f();
		color = new Color3f(Color3f.white);
	}

	public Vertex3f(float p0, float p1, float p2, float n0, float n1, float n2,
			float t0, float t1, float c0, float c1, float c2) {
		position = new Vector3f(p0, p1, p2);
		normal = new Vector3f(n0, n1, n2);
		uvCoordinate = new Vector2f(t0, t1);
		color = new Color3f(c0, c1, c2);
	}

	public Vertex3f(Vector3f position, Vector3f normal, Vector2f texture) {
		this.position = new Vector3f(position);
		this.normal = new Vector3f(normal);
		this.uvCoordinate = new Vector2f(texture);
		color = new Color3f(Color3f.white);
	}

	public Vertex3f(Vertex3f v0) {
		position = new Vector3f(v0.position);
		normal = new Vector3f(v0.normal);
		uvCoordinate = new Vector2f(v0.uvCoordinate);
		color = new Color3f(v0.color);
	}

	public Color3f getColor() {
		return color;
	}

	public void setColor(Color3f color) {
		this.color = color;
	}

	public Vector3f getPosition() {
		return position;
	}

	public void setPosition(Vector3f position) {
		this.position = position;
	}

	public Vector3f getNormal() {
		return normal;
	}

	public void setNormal(Vector3f normal) {
		this.normal = normal;
	}

	public Vector2f getUVCoordinate() {
		return uvCoordinate;
	}

	public void setUVCoordinate(Vector2f uvCoordinate) {
		this.uvCoordinate = uvCoordinate;
	}

	public float[] toFloatArray() {
		return new float[] { position.x, position.y, position.z, normal.x,
				normal.y, normal.z, uvCoordinate.x, uvCoordinate.y };
	}

}
